# -*- coding:utf-8 -*-
"""
Created on Apr 28, 2011

@author: Lithuanian
"""
from algorithm import Heuristic
class numOfPilesPenalty(Heuristic):
    
    def __init__(self, penalty = None, isMul = None):
        if isMul is None:
            self.isMul   = False
        else:
            self.isMul   = isMul
        if penalty is None:
            self.penalty = 3
        else:
            self.penalty = penalty
    
    def evaluate(self, problem_state):
        if self.isMul:
            val = len(problem_state.dirt_locations)*self.penalty
        else:
            val = len(problem_state.dirt_locations)**self.penalty
        return val